package com.edu.zut.hb.software.server.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.edu.zut.hb.software.server.mapper.MqmsgMapper;
import com.edu.zut.hb.software.server.pojo.Mqmsg;
import com.edu.zut.hb.software.server.service.IMqmsgService;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author ifax
 * @since 2021-08-20
 */
@Service
public class MqmsgServiceImpl extends ServiceImpl<MqmsgMapper, Mqmsg> implements IMqmsgService {

    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    @Override
    public boolean save(Mqmsg msg) {
        msg.setPubtime(sdf.format(new Date(System.currentTimeMillis())));
        return super.save(msg);
    }
}
